package com.hibernate.generator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@Table(name = "sample_ts")
public class SampleTableSeq {

	public Integer id;
	public String name;

	@Id
	@TableGenerator(name = "sample_id_gen", table = "id_gen", pkColumnName = "gen_name", pkColumnValue = "sample_id", valueColumnName = "gen_val",
			initialValue=0, allocationSize=1
		)
	@GeneratedValue(strategy = GenerationType.TABLE, generator="sample_id_gen")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
